
<template>
  <div class="choiceBox">
    <div class="logincontent">
      <img
        class="loginImg"
        :src="require('@/assets/imges/loginImg.png')"
        alt=""
        srcset=""
      />
      <div class="loginBtnBox">
        <div class="register" @click="loginOrRegisterFn(4)"><i>注册</i></div>
        <div class="phoneLogin" @click="loginOrRegisterFn(3)">
          <i>手机号登录</i>
        </div>
        <div class="emailLogin" @click="loginOrRegisterFn(2)">
          <i>邮箱登录</i>
        </div>
      </div>
    </div>
    <div class="TermsOfService">
      <input type="checkbox" v-model="clause" /><span>同意</span>
      <a href="https://st.music.163.com/official-terms/service">《服务条款》</a>
      <a href="https://st.music.163.com/official-terms/privacy">《隐私政策》</a>
      <a href="https://st.music.163.com/official-terms/children"
        >《儿童隐私政策》</a
      >
    </div>
  </div>
</template>

<script>
import { Notification } from "element-ui";
import { mapActions } from "vuex";
export default {
  data() {
    return {
      clause: true,
    };
  },
  methods: {
    ...mapActions("loginStore", ["setChange_ChoiceNum"]),
    loginOrRegisterFn(num) {
      if (!this.clause) {
        Notification({
          title: "提示",
          message: "请先勾选同意《服务条款》、《隐私政策》、《儿童隐私政策》",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      this.setChange_ChoiceNum(num);
    },
  },
};
</script>

<style lang="scss" scoped>
.choiceBox {
  display: flex;
  flex: 1;
  flex-direction: column;
}
.logincontent {
  padding: 40px 0 39px;
  flex: 4;
  background: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  .loginImg {
    height: 120px;
    width: 224px;
  }
  .loginBtnBox {
    width: 220px;
    .register,
    .phoneLogin,
    .emailLogin {
      margin-top: 10px;
      border-radius: 4px;
      color: #333;
      text-align: center;
      display: inline-block;
      overflow: hidden;
      padding: 0 5px 0 0;
      cursor: pointer;
      background: url("./../../assets/imges/backgroundStripe.png") no-repeat
        right -100px;
      i {
        width: 170px;
        height: 31px;
        padding: 0 15px 0 20px;
        font-size: 12px;
        line-height: 31px;
        background: url("./../../assets/imges/backgroundStripe.png") no-repeat 0 -59px;
        display: inline-block;
      }
    }
    .phoneLogin,
    .emailLogin {
      background: url("./../../assets/imges/backgroundStripe.png") no-repeat
        right -428px;
      i {
        background: url("./../../assets/imges/backgroundStripe.png") no-repeat 0 -387px;
        color: #fff;
      }
    }
  }
}
.TermsOfService {
  flex: 1;
  font-size: 10px;
  padding-left: 40px;
  color: rgba(0, 0, 0, 0.4);
  a {
    color: #507daf;
    cursor: pointer;
    text-decoration: none;
  }
}
</style>